<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('批量增加用户金额')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-WxUser-addAllBalance">
        <div class="form-group">
            <label class="col-sm-3 control-label">请输入要增加的金额：</label>
            <div class="col-sm-8">
                <input name="number" class="form-control" oninput="value=value.replace(/[^\d]/g,'')" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "wechatprogram/WxUser"
    $("#form-WxUser-addAllBalance").validate({
        focusCleanup: true
    });

    //保存信息 刷新表格
    function submitHandler(callback) {
        var number = $("input[name=number]").val();
        $.modal.confirm("确定给全体员工增加金额：" + number + "元吗？", function () {
            var config = {
                url: prefix + "/addAllBalanceSave",
                type: "post",
                dataType: "json",
                data: {
                    "number": number
                },
                beforeSend: function () {
                    $.modal.loading("正在处理中，请稍后...");
                    $.modal.disable();
                },
                success: function (result) {
                    if (typeof callback == "function") {
                        callback(result);
                    }
                    $.operate.successCallback(result);
                }
            };
            $.ajax(config)
        });
    }

</script>
</body>
</html>